home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 123 / MacAddict_123_2006_11.iso / Software / Productivity / iClip lite 2.wdgt / js / prefs.js < prev    next >
Text File  |  2006-06-14  |  481b  |  23 lines

  1. // Copyright ¬© 2006, Inventive. //
  2.  
  3. // Functions //
  4.  
  5.     function getPref(key, defaultValue) {
  6.         if (window.widget) {
  7.             if (widget.preferenceForKey(createKey(key)) != null)
  8.                 return widget.preferenceForKey(createKey(key));
  9.         }
  10.         return defaultValue;
  11.     }
  12.     
  13.     function setPref(key, value) {
  14.         if (window.widget)
  15.             widget.setPreferenceForKey(value, createKey(key));
  16.     }
  17.     
  18.     function createKey(key) {
  19.         if (window.widget)
  20.             return widget.identifier + "-" + key;
  21.         else
  22.             return key;
  23.     }